home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / Miro_Downloader.exe / clock.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2007-11-12  |  1.1 KB  |  37 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.5)
  3.  
  4. from time import *
  5. import sys
  6. import threading
  7. _MAXFORWARD = 100
  8. _FUDGE = 1
  9.  
  10. class RelativeTime:
  11.     
  12.     def __init__(self):
  13.         self.time = time()
  14.         self.offset = 0
  15.         self.lock = threading.Lock()
  16.  
  17.     
  18.     def get_time(self):
  19.         self.lock.acquire()
  20.         
  21.         try:
  22.             t = time() + self.offset
  23.             self.time = t
  24.         finally:
  25.             self.lock.release()
  26.  
  27.         return t
  28.  
  29.  
  30. if sys.platform != 'win32':
  31.     _RTIME = RelativeTime()
  32.     
  33.     def clock():
  34.         return _RTIME.get_time()
  35.  
  36.  
  37.